<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-theme="<%= current_theme_key %>" >
  <head>
    <title><%= page_title %></title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="tour-language" content="<%= I18n.locale %>">
    <meta name="turbo-cache-control" content="no-cache">

    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
    <%= action_cable_meta_tag %>

    <%= yield :head %>

    <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
    <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>

    <link rel="icon" href="<%= asset_url('icon.png') %>" type="image/png">
    <link rel="icon" href="<%= asset_url('icon.svg') %>" type="image/svg+xml">
    <link rel="apple-touch-icon" href="<%= asset_url('icon.png') %>">

    <%# Vendors Files %>
    <%= stylesheet_link_tag "animate.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "select2.min.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "flatpickr.min.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "driverjs.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "coloris.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "tabler-icons.min", "data-turbo-track": "reload" %>

    <%= javascript_include_tag 'simplemde.min', "data-turbo-track": "reload" %>
    <%= javascript_include_tag 'simplemde.override', "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag 'simplemde.min', "data-turbo-track": "reload" %>

    <%# Includes all stylesheet files in app/assets/stylesheets %>
    <%= stylesheet_link_tag "tailwind.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "alert-messages.css", "data-turbo-track": "reload" %>
    <%= stylesheet_link_tag "animations.css", "data-turbo-track": "reload" %>

    <%= javascript_importmap_tags %>
    <%= javascript_pack_tag "application" %>
  </head>

  <body class="antialiased min-h-screen bg-base-200/50">
    <%= app_tour_tags %>

    <div id="alert-messages">
      <%= render "layouts/flash_messages" %>
    </div>

    <div id="modal-area"></div>

    <main class="flex h-screen overflow-hidden">
      <div class="relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden">
        <%= render "layouts/header" %>
         <% if skip_layout_content_wrapper? %>
          <%= yield %>
         <% else %>
          <main class="grow p-4 sm:p-8">
            <div class="mx-auto <%= layout_with_header_width? ? 'w-header' : 'lg:max-w-4xl' %>">
              <%= yield %>
            </div>
          </main>
        <% end %>
      </div>
    </main>

    <%= render partial: "layouts/issue_detail", locals: issue_detail_context %>
    <%= render partial: "layouts/confirm_modal" %>
    <%= render partial: "layouts/upgrade_modal" %>
  </body>
</html>
